/*
 * Test
 * Version: 0.1
 * Date: 2008-10-26
 * Author: gp08-nhn
 */

package test;

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

class FullScreen extends JFrame {
	
	private static final long serialVersionUID = 3971702869044936103L;
	
	FullScreen() {
		super("Test Window");
		
		setDefaultCloseOperation(EXIT_ON_CLOSE);
		setSize(200, 200);
		setLocation(100, 100);
		
		//getContentPane().add(new Label("asdf"));
		
		setResizable(false);
		
		setUndecorated(true);
		
		JMenuBar menuBar = new JMenuBar();
		JMenu m_Game;
		JMenuItem m_NewGame;
		String cache;
		
		menuBar.add(m_Game = new JMenu(cache = "Menu"));
		m_Game.setMnemonic(cache.charAt(0));
		m_Game.addMouseListener(new MouseAdapter() {
			public void mousePressed(final MouseEvent e) {
				//Game.pause();
			} // end method
		} // end class
		);
		
	    m_Game.add(m_NewGame = new JMenuItem(cache = "Exit", cache.charAt(0)));
	    m_NewGame.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, ActionEvent.ALT_MASK));
		m_NewGame.addActionListener(
			new ActionListener() {
				public void actionPerformed(final ActionEvent e) {
					System.out.println("menu test: "+e.toString());
					System.exit(0);
				} // end method
			} // end class
	    );
		
		setJMenuBar(menuBar);
		
		setVisible(true);
	}
	
	public static void main(String[] args) {
		
		FullScreen a = new FullScreen();
		
		GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
		GraphicsDevice[] gs = ge.getScreenDevices();
		int k = 0;
		for(DisplayMode dm : gs[0].getDisplayModes()) {
			System.out.println((k++) + ":" + dm.getWidth() + "�" + dm.getHeight() + "�" + dm.getBitDepth() + " @" + dm.getRefreshRate());
		}
		try {
			Thread.sleep(1000);
		} catch(InterruptedException e) {
			e.printStackTrace();
		}
		gs[0].setFullScreenWindow(a);
		gs[0].setDisplayMode(gs[0].getDisplayModes()[53]);

		//gs[0].setFullScreenWindow(null);
		
	} // end main method
} // end class
